<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <title>register</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
         
        html {
            height: 100%;
            width: 100%;
            overflow: hidden;
            margin: 0;
            padding: 0;
            background: url(https://img2.baidu.com/it/u=4257176988,3908367737&fm=253&fmt=auto&app=138&f=JPEG?w=780&h=488) no-repeat 0px 0px;
            background-size: 100% 100%;
            -moz-background-size: 100% 100%;
        }
         
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
         
        #loginDiv {
            width: 400px;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 400px;
            background-color: rgba(75, 81, 95, 0.3);
            box-shadow: 7px 7px 17px rgba(52, 56, 66, 0.5);
            border-radius: 250px;
        }
         
        
        p {
            margin-top: 30px;
            margin-left: 20px;
            color: azure;
        }
         
        input {
            margin-left: 15px;
            border-radius: 5px;
            border-style: hidden;
            height: 30px;
            width: 140px;
            background-color: rgba(216, 191, 216, 0.5);
            outline: none;
            color: #f0edf3;
            padding-left: 10px;
        }
         
        .button {
            border-color: cornsilk;
            background-color: rgba(100, 149, 237, .7);
            color: aliceblue;
            border-style: hidden;
            border-radius: 5px;
            width: 100px;
            height: 31px;
            font-size: 16px;
        }
    </style>
    <style type="text/css">
        input::-ms-input-placeholder{text-align: center;}
        input::-webkit-input-placeholder{text-align: center;}
    </style>
    <script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.26.0/axios.min.js"></script>
</head>
 
<body>
    <div id="loginDiv">
        <form action="" id="app">
            <p>姓名:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="name" type="text" v-model="uname"></p>
            <p>账号:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="account" type="text" v-model="uacc"></p>
            <p>密码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="password" type="password" placeholder="密码不为空" v-model="upwd"></p>
            <p>确认密码:<input id="repwd" type="password" v-model="repwd"></p>
            <div style="text-align: center;margin-top: 30px;">
                <input type="button" class="button" value="注册" @click.prevent="register">
            </div>
        </form>
 
        <script>
            var v = new Vue({
                el:"#app",
                data:{
                    uacc: "",
                    upwd: "",
                    repwd: "",
                    phone: "",
                    address: "",
                    uemail: "",
                    uname: ""
                },
                methods:{
                    register(){
                        if(this.upwd==this.repwd){
                            let url = "/adminUser/register";
                            let params = new URLSearchParams();
                            params.append("uacc",this.uacc);
                            params.append("upwd",this.upwd);
                            params.append("uphone",this.phone);
                            params.append("uemail",this.uemail);
                            params.append("uaddress",this.address);
                            params.append("uname",this.uname);
                            axios.post(url,params).then(res=>{
                                if(res.data.code==1){
                                    window.location.href="login";
                                }
                            })
                        }else{
                            alert("密码不一致");
                        }
                    }
                }
            })
        </script>
    </div>
 
</body>
</html>